public class test57 {
    public static void main(String[] args) {
        double tuition = 10000; // 今年学费
        double rate = 0.05;  
        for (int i = 1; i <= 10; i++) {
            tuition *= (1 + rate);
        }
        System.out.printf("10年后的学费为: $%.2f%n", tuition);
        double total = 0;
        for (int i = 1; i <= 4; i++) {
            total += tuition;
            tuition *= (1 + rate);
        }
        System.out.printf("10年后算起，4年内总学费为: $%.2f%n", total);
    }
}

